package router

import (
	"github.com/gin-gonic/gin"
	. "go_test/src/code.song.study/webGoin/controller"
)

// 全局路由配置
func InitRouter() *gin.Engine {
	router := gin.Default()

	// 测试服务
	router.GET("/", HelloTest)
	router.GET("/hello", HelloTest)
	// 路径参数
	router.GET("/user/:name/:id", UserTest)

	// post 表单
	router.POST("/user/post/form", UserTestPostForm)
	// POST application/json
	router.POST("/user/post", UserTestPostJson)
	return router
}
